<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.cmccsi.mapper.qxdeptDtoMapper" >
  <resultMap id="BaseResultMap" type="com.cmccsi.entity.qxdeptDto" >
    <id column="id" property="id" jdbcType="BIGINT" />
    <result column="parent_id" property="parentId" jdbcType="BIGINT" />
    <result column="name" property="name" jdbcType="VARCHAR" />
    <result column="domainid" property="domainid" jdbcType="VARCHAR" />
    <result column="complete_spellings" property="completeSpellings" jdbcType="VARCHAR" />
    <result column="initials" property="initials" jdbcType="VARCHAR" />
    <result column="status" property="status" jdbcType="INTEGER" />
    <result column="type" property="type" jdbcType="INTEGER" />
    <result column="sort" property="sort" jdbcType="INTEGER" />
    <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
    <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
  </resultMap>
  <sql id="Base_Column_List" >
    id, parent_id, name, domainid, complete_spellings, initials, status, type, sort, 
    create_time, update_time
  </sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
    select 
    <include refid="Base_Column_List" />
    from qxdept
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
    delete from qxdept
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <insert id="insert" parameterType="com.cmccsi.entity.qxdeptDto" >
    insert into qxdept (id, parent_id, name, 
      domainid, complete_spellings, initials, 
      status, type, sort, 
      create_time, update_time)
    values (#{id,jdbcType=BIGINT}, #{parentId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, 
      #{domainid,jdbcType=VARCHAR}, #{completeSpellings,jdbcType=VARCHAR}, #{initials,jdbcType=VARCHAR}, 
      #{status,jdbcType=INTEGER}, #{type,jdbcType=INTEGER}, #{sort,jdbcType=INTEGER}, 
      #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
  </insert>
  <insert id="insertSelective" parameterType="com.cmccsi.entity.qxdeptDto" >
    insert into qxdept
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        id,
      </if>
      <if test="parentId != null" >
        parent_id,
      </if>
      <if test="name != null" >
        name,
      </if>
      <if test="domainid != null" >
        domainid,
      </if>
      <if test="completeSpellings != null" >
        complete_spellings,
      </if>
      <if test="initials != null" >
        initials,
      </if>
      <if test="status != null" >
        status,
      </if>
      <if test="type != null" >
        type,
      </if>
      <if test="sort != null" >
        sort,
      </if>
      <if test="createTime != null" >
        create_time,
      </if>
      <if test="updateTime != null" >
        update_time,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        #{id,jdbcType=BIGINT},
      </if>
      <if test="parentId != null" >
        #{parentId,jdbcType=BIGINT},
      </if>
      <if test="name != null" >
        #{name,jdbcType=VARCHAR},
      </if>
      <if test="domainid != null" >
        #{domainid,jdbcType=VARCHAR},
      </if>
      <if test="completeSpellings != null" >
        #{completeSpellings,jdbcType=VARCHAR},
      </if>
      <if test="initials != null" >
        #{initials,jdbcType=VARCHAR},
      </if>
      <if test="status != null" >
        #{status,jdbcType=INTEGER},
      </if>
      <if test="type != null" >
        #{type,jdbcType=INTEGER},
      </if>
      <if test="sort != null" >
        #{sort,jdbcType=INTEGER},
      </if>
      <if test="createTime != null" >
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null" >
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.cmccsi.entity.qxdeptDto" >
    update qxdept
    <set >
      <if test="parentId != null" >
        parent_id = #{parentId,jdbcType=BIGINT},
      </if>
      <if test="name != null" >
        name = #{name,jdbcType=VARCHAR},
      </if>
      <if test="domainid != null" >
        domainid = #{domainid,jdbcType=VARCHAR},
      </if>
      <if test="completeSpellings != null" >
        complete_spellings = #{completeSpellings,jdbcType=VARCHAR},
      </if>
      <if test="initials != null" >
        initials = #{initials,jdbcType=VARCHAR},
      </if>
      <if test="status != null" >
        status = #{status,jdbcType=INTEGER},
      </if>
      <if test="type != null" >
        type = #{type,jdbcType=INTEGER},
      </if>
      <if test="sort != null" >
        sort = #{sort,jdbcType=INTEGER},
      </if>
      <if test="createTime != null" >
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null" >
        update_time = #{updateTime,jdbcType=TIMESTAMP},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.cmccsi.entity.qxdeptDto" >
    update qxdept
    set parent_id = #{parentId,jdbcType=BIGINT},
      name = #{name,jdbcType=VARCHAR},
      domainid = #{domainid,jdbcType=VARCHAR},
      complete_spellings = #{completeSpellings,jdbcType=VARCHAR},
      initials = #{initials,jdbcType=VARCHAR},
      status = #{status,jdbcType=INTEGER},
      type = #{type,jdbcType=INTEGER},
      sort = #{sort,jdbcType=INTEGER},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      update_time = #{updateTime,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>